cmake_minimum_required(VERSION 3.22)
project(BMIS C)

set(CMAKE_C_STANDARD 99)

include_directories(${PROJECT_SOURCE_DIR}/include)

#add_executable(demo1107_proj src/main.c)

# 关键：批量匹配 src 目录下所有 .c 文件，存入变量 SRC_FILES
# file(GLOB 变量名 "路径匹配规则")：按指定规则匹配文件，将文件路径列表存入变量；
file(GLOB SRC_FILES "${PROJECT_SOURCE_DIR}/src/*.c")
add_executable(BMIS
        ${SRC_FILES}
        # 公共文件（两个指令都包含的部分）
        include/database.h src/database.c
        include/front.h include/back.h src/back.c src/front.c
        include/front_user.h src/front_user.c
        src/front_user_menu.c include/front_user_menu.h
        src/user_query.c include/user_query.h
        src/back_admin.c include/back_admin.h
        src/back_admin_menu.c include/back_admin_menu.h
        src/admin_query.c include/admin_query.h
        include/admin_menu.h include/admin_select.h include/admin_user.h
        src/admin_function.c src/admin_select.c include/admin_function.h
        src/admin_show.c include/borrow.h src/borrow.c include/admin_show.h
        include/return.h src/return.c

        src/admin_front_user.c include/admin_front_user.h
        include/front_user_updateid.h src/front_user_updateid.c
        src/show_user.c include/show_user.h)